package com.itheima.mapper;

import com.itheima.pojo.OrderSetting;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface OrderSettingDao {

    @Select("select * from t_ordersetting where orderDate between #{startDay} and #{endDay}")
    List<OrderSetting> getOrderSettingByMonth(LocalDate startDay, LocalDate endDay);

    @Update("update t_ordersetting set number = #{number} where orderDate = #{orderDate}")
    void editNumberByOrderDate(OrderSetting orderSetting);

    void saveAll(List<OrderSetting> orderSettings);
}
